package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Nickname string `gorm:"type:varchar(20);comment:昵称"`
	Title    string `gorm:"type:varchar(30);comment:标题"`
	Mobile   string `gorm:"type:char(11);comment:手机号"`
	Address  string `gorm:"type:varchar(50);comment:地址"`
	Status   string `gorm:"type:tinyint(1);comment:性别:0男1女"`
}
type Video struct {
	gorm.Model
	Videos   string `gorm:"type:varchar(300);comment:视频"`
	Title    string `gorm:"type:varchar(30);comment:标题"`
	Address  string `gorm:"type:varchar(50);comment:地址"`
	VideosHe string `gorm:"type:varchar(40);comment:合集"`
	SetUt    string `gorm:"type:varchar(60);comment:设置"`
}

func (u *User) CreateCode() error {
	return Db.Create(&u).Error
}
func (u *User) CreateMobile(mobile string) error {
	return Db.Where("mobile = ?", mobile).First(&u).Error
}
